<!-- 人群预测 -->
<template>
  <div class="mainTable">
    <BaseTable :query="query" :tableItems="tableItems" :updateItems="updateItems" :optionList="optionList" :Btn="Btn"
      menuName="logRecord" pageName="mainTable" />
  </div>
</template>
<script>
import dayjs from "dayjs"
import BaseTable from "../../table/rqycTable.vue";
import { service } from "../../../services/backServices";
export default {
  name: "rqyc",
  data() {
    return {
      //后端人员修改-S
      //查询参数
      query: {
        "predictObj": { type: "select", placeholder: "请选择", value: "大促", name: "预测对象" },
        //仅预测对象为：大促
        "predictBigPromoYear": { showBy:"predictObj",showValue:"大促", type: "time", timeType:'year',placeholder: "请输入", value: "2023", name: "预测大促年份", format:"yyyy", valueFormat:"yyyy" },
        "predictBigPromoName": { showBy:"predictObj",showValue:"大促",type: "select", placeholder: "请输入", value: "双十一", name: "预测大促名称" },
        "refBigPromoYear":{ showBy:"predictObj",showValue:"大促",type: "time", timeType:'year', placeholder: "非必填", value: "", name: "参考大促年份", format:"yyyy", valueFormat:"yyyy" },
        "refBigPromoName":{ showBy:"predictObj",showValue:"大促",type: "select", placeholder: "非必填", value: "", name: "参考大促名称" },
        //仅预测对象为：月
        "predict_month": { showBy:"predictObj",showValue:"月",type: "time", timeType:'month', placeholder: "请输入", value: "", format:"yyyy-MM", valueFormat:"yyyy-MM", name: "预测月份" },
        
        //通用字段
        "estTransAmountGoal": { type: "input", placeholder: "请输入", value: "32000000", name: "生意目标" },
        "estAvgOrderPrice": { type: "input", placeholder: "请输入", value: "74", name: "客单价" },
        "benchmarkMultiple": { type: "input", placeholder: "请输入", value: "0.7", name: "benchmark倍数" },
        "actPopPredRefMonth": { type: "time", timeType:'month', placeholder: "非必填", value: "", format:"yyyy-MM", valueFormat:"yyyy-MM", name: "活动期人群预测参考月" },
        "stoPromoPredRefMonth": { type: "time", timeType:'month', placeholder: "非必填", value: "2023-08", format:"yyyy-MM", valueFormat:"yyyy-MM", name: "蓄水期推广预测参考月" },
        "actPromoPredRefMonth": { type: "time", timeType:'month', placeholder: "非必填", value: "", format:"yyyy-MM", valueFormat:"yyyy-MM", name: "活动期推广预测参考月" },
        "stoEstFeeZ": { type: "input", placeholder: "请输入", value: "980003", name: "蓄水期预计直通车花费" },
        "stoEstFeeY": { type: "input", placeholder: "请输入", value: "0", name: "蓄水期预计引力魔方花费" },
        "stoEstFeeW": { type: "input", placeholder: "请输入", value: "988575", name: "蓄水期预计万相台花费" },
        "stoEstFeeP": { type: "input", placeholder: "请输入", value: "0", name: "蓄水期预计品销宝花费" },
        "actEstFeeZ": { type: "input", placeholder: "请输入", value: "770000", name: "活动期预计直通车花费" },
        "actEstFeeY": { type: "input", placeholder: "请输入", value: "190000", name: "活动期预计引力魔方花费" },
        "actEstFeeW": { type: "input", placeholder: "请输入", value: "0", name: "活动期预计万相台花费" },
        "actEstFeeP": { type: "input", placeholder: "请输入", value: "0", name: "活动期预计品销宝花费" },
        "avgCostMultipleSto": { type: "input", placeholder: "请输入", value: "1.05,1.05,1.05,1.05,1.05,1.05", name: "蓄水期推广渠道人均成本倍数" },
        "avgCostMultipleAct": { type: "input", placeholder: "请输入", value: "1.1,1.1,1", name: "活动期推广渠道人均成本倍数" },
        "overlapMultipleSto": { type: "input", placeholder: "请输入", value: "0.95,0.95,0.95,0.95,0.95,0.95", name: "蓄水期付费重合度倍数" },
        "overlapMultipleAct": { type: "input", placeholder: "请输入", value: "1,1,1", name: "活动期付费重合度倍数" },
        "paidExppopPropMultipleSto": { type: "input", placeholder: "请输入", value: "1,2.5,1,2.5,1.1,1", name: "蓄水期付费曝光占比倍数" },
        "paidExppopPropMultipleAct": { type: "input", placeholder: "请输入", value: "1,1,1", name: "活动期付费曝光占比倍数" },
      },

      //表格表头
      tableItems: null,


      //增删查改的对象属性
      updateItems: [//edit是回复
        { name: "文件名称", prop: "fileName", type: "input", disabled: true },
        { name: "上传类型", prop: "uploadType", type: "select" },
        { name: "备注", prop: "remark", type: "textarea" },
        { name: "上传文件", prop: "fileAdd", type: "upload" },
      ],
      //增删查改的对象属性的下拉select或者级联cascader
      optionList: {
        unit: [
          { label: "日", value: "日" },
          { label: "周", value: "周" },
          { label: "月", value: "月" },
          { label: "年", value: "年" },
        ],
        predictObj: [
          { label: "大促", value: "大促" },
          { label: "月", value: "月" },
        ],
        predictBigPromoName: [],
        refBigPromoName:[]
      },

      //自定义btn功能
      Btn: {
        search: true, //查询按钮
        add: false, //添加按钮
        edit: false, //回复按钮
        detail: false, //详情按钮
        delete: false, //删除按钮
        deletes: false, //批量删除按钮
        export: true, //导出按钮
        templateDownload: false, //模板下载按钮
        upload: false, //上传按钮
      },
      //后端人员修改-E
    };
  },
  components: {
    BaseTable
  },
  created() {
    service({
        method: 'post',
        url: 'getAllBigPromotionName',
      }).then((res) => {
        if(res.data.code == 200) {
          let theOptionList = res.data.data.map(x =>{
            return {
              label: x,
              value: x
            }
          })
          this.optionList.predictBigPromoName = theOptionList
          this.optionList.refBigPromoName = theOptionList
        }
      })

  },
  
};
</script>
<style scoped lang="less">
.mainTable {
  background-color: #f1f2f9;
}
</style>